package com.campus.secondhand;

import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * 校园二手交易平台应用启动类
 */
@SpringBootApplication
@EnableTransactionManagement
public class CampusSecondHandApplication {

    public static void main(String[] args) {
        SpringApplication.run(CampusSecondHandApplication.class, args);
    }

    @Bean
    public RestHighLevelClient client() {
        return new RestHighLevelClient(RestClient.builder(
                HttpHost.create("http://localhost:9200")));
    }
}
